﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using NHibernate;
using DotNet.Common.NHibernateUtil;
using ZLCMS.Data.Model;
using NHibernate.Criterion;
using System.Collections.Generic;
using ZLCMS.Business.Util;

namespace ZLCMS.Web
{
    public partial class MainMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            using (ISession session = SessionFactoryHelper.CreateSession())
            {
               // CMSKits.BindTypeListByKind(rp_footer_nav_1, session, "FooterNav", -1);
                AdsKits.BindAdsListByPositionCode(rpt_activity, session, "Search", -1);
                ZLCMS.Business.Util.CMSKits.BindDocListByKind(rpt_qqlist, session, "QQSet", 3);
            }
        }

      

        public string GetNavHtml(string kind)
        {
            string htmStr = "";
            using (NHibernate.ISession session = SessionFactoryHelper.CreateSession())
            {
                CmsModuleData data = session.CreateQuery("from CmsModuleData where Id=:kind").SetParameter("kind",kind).UniqueResult<CmsModuleData>();
                htmStr = data == null ? "" : data.Content;
            }
            return htmStr;

        }
    }
}
